-module('ex_8.5_chomping_trailing_lines').

-include_lib("eunit/include/eunit.hrl").

-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").

single_test_() ->
    ?_assertMatch(
      {yamerl_parser,
        {file,?FILENAME},
        [],
        <<>>,
        152,
        true,
        [],
        0,
        153,
        20,
        1,
        false,
        19,
        14,
        utf8,
        false,
        undefined,
        _,
        _,
        [],
        {bcoll,root,0,-1,1,1,-1,1,1},
        false,
        false,
        false,
        [{impl_key,false,false,undefined,undefined,1,1}],
        false,
        false,
        _,
        [],
        0,
        19,
        18,
        undefined,
        undefined,
        _,
        false,
        [],
        [
          {yamerl_stream_end,19,14},
          {yamerl_doc_end,19,14},
          {yamerl_collection_end,19,14,block,mapping},
          {yamerl_scalar,15,7,
            {yamerl_tag,15,7,{non_specific,"!"}},
            block,literal,"# text\n\n"},
          {yamerl_mapping_value,15,5},
          {yamerl_scalar,15,1,
            {yamerl_tag,15,1,{non_specific,"?"}},
            flow,plain,"keep"},
          {yamerl_mapping_key,15,1},
          {yamerl_scalar,9,7,
            {yamerl_tag,9,7,{non_specific,"!"}},
            block,literal,"# text\n"},
          {yamerl_mapping_value,9,5},
          {yamerl_scalar,9,1,
            {yamerl_tag,9,1,{non_specific,"?"}},
            flow,plain,"clip"},
          {yamerl_mapping_key,9,1},
          {yamerl_scalar,3,8,
            {yamerl_tag,3,8,{non_specific,"!"}},
            block,literal,"# text"},
          {yamerl_mapping_value,3,6},
          {yamerl_scalar,3,1,
            {yamerl_tag,3,1,{non_specific,"?"}},
            flow,plain,"strip"},
          {yamerl_mapping_key,3,1},
          {yamerl_collection_start,3,1,
            {yamerl_tag,3,1,{non_specific,"?"}},
            block,mapping},
          {yamerl_doc_start,3,1,{1,2},_},
          {yamerl_stream_start,1,1,utf8}
        ]
      },
      yamerl_parser:file(?FILENAME)
    ).
